2ccd95c88a236a273798d7ffaec5331027078207,library/src/main/java/com/github/nisrulz/sensey/Sensey.java,Sensey,startOrientationDetection,#OrientationDetector.OrientationListener#,94

Before Change



  public void startOrientationDetection(
      OrientationDetector.OrientationListener orientationListener) {
    if (sensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION) != null) {
      orientationDetector = new OrientationDetector(orientationListener);

      sensorManager.registerListener(orientationDetector.sensorEventListener,

After Change


      OrientationDetector.OrientationListener orientationListener) {

    Sensor accelerometer = sensorManager.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
    Sensor magnetometer = sensorManager.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
    if (accelerometer != null && magnetometer != null) {
      orientationDetector = new OrientationDetector(orientationListener);
      sensorManager.registerListener(orientationDetector.sensorEventListener, accelerometer,
          SensorManager.SENSOR_DELAY_NORMAL);